package com.itheima.homework.Employee_manager;

public class Employee {
    /**
     * 创建一个Employee类，其中包含姓名、年龄和工资的私有实例变量。
     * 实现计算工资和显示员工信息的方法。使用静态变量跟踪员工总数。
     * 为不同类型的雇员(例如，经理、工程师)创建子类，这些子类具有计算工资的特定行为。
     */

    static int count;

    private String name;
    private int age;
    private double salary;

    public Employee() {
        count++;
    }

    public Employee(String name, int age, double salary) {
        this.name = name;
        this.age = age;
        this.salary = salary;
    }

    public static int getCount() {
        return count;
    }

    public static void setCount(int count) {
        Employee.count = count;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    // 显示员工信息的方法
    public void info() {
        System.out.println("员工: " + this.getName() + " 年龄：" + this.getAge() + " 工资：" + this.calcSalary());
    }

    // 计算工资
    public double calcSalary() {
        double finalSalary = this.getSalary() * 1.2;
        return finalSalary;
    }
}
